﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ComponentModel;

namespace Resxus.Model
{
    public class ResourceRecord : PropertyNotificationObject    
    {
        public ResourceFile File
        {
            get;
            set;
        }


        private bool _IsMatch = false;
        public bool IsMatch 
        {
            get
            {
                return this._IsMatch;
            }

            set
            {
                if (this._IsMatch.Equals(value) == false)
                {                                   
                    this.OnPropertyChanged("IsMatch", this._IsMatch, value);
                    this._IsMatch = value;
                    //this.NotifyPropertyChanged("IsMatch");
                }
            }
        }

        private string _ID = string.Empty;
        public string ID 
        { 
            get
            {
                return this._ID;
            }
            set
            {
                if (this._ID.Equals(value) == false)
                {
                    this.OnPropertyChanged("ID", this._ID, value);
                    this._ID = value;
                    //this.NotifyPropertyChanged("ID");
                }
            }
        }

        private string _Value = string.Empty;
        public string Value 
        { 
            get
            {
                return this._Value;
            }

            set
            {
                if (this._Value.Equals(value) == false)
                {
                    this.OnPropertyChanged("ID", this._Value, value);
                    this._Value = value;
                    //this.NotifyPropertyChanged("Value");
                }
            }
        }

        public bool Equals(ResourceRecord obj)
        {
            return (this.File.Equals(obj.File) && this.ID.Equals(obj.ID) && this.Value.Equals(obj.Value));
        }

        #region INotifyPropertyChanged 멤버

        //public event PropertyChangedEventHandler PropertyChanged;

        /*
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
        */
        #endregion
    }
}
